<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@  page import="java.util.*"%>
<%@  page import="java.util.HashMap"%>
<%@  taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="my" uri="/mytag"%>
<!DOCTYPE>
<html>
<head>
<meta charset="UTF-8">
<link href="AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet"
	type="text/css" />
<link href="AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/personal.css">
<link rel="stylesheet" href="css/site-nav.css">
<link rel="stylesheet" href="css/ordersstyle.css">
<script src="js/basevalue.js"></script>
<script type="text/javascript" src="basic/js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="AmazeUI-2.4.2/assets/js/amazeui.js"></script>
<title>my orders</title>
</head>
<body>
	<div class="site-nav">
		<div class="sn-bg"></div>
		<div class="sn-con">
			<p class="sn-home">
				<i class="am-icon-home"></i> <a href="index.jsp">爱购首页</a>
			</p>
			<p class="sn-login-info">
				<c:if test="${ empty sessionScope.u.nickname }" var="login">
					<span>汪, 欢迎来到爱购 </span>
					<span> &nbsp;<a href="login.jsp">请登录</a>
					</span>
					<span class="sn-logout-info"> <a href="regist.jsp">免费注册</a>
					</span>
				</c:if>
				<c:if test="${!login }">
					<span>Hi, <a href="">${sessionScope.u.nickname }</a>
					</span>
					<span> <i class="am-icon-comments"></i>&nbsp;消息<a href="">3</a>
					</span>
					<span class="sn-logout-info"> <a href="user/logout.do">退出</a>
					</span>
				</c:if>
			</p>
			<ul class="sn-quick-menu">
				<li class="myiGo"><i class="am-icon-user"></i> <a
					href="myorders.do">我的爱购</a></li>
				<li class="sn-mybrand"><i class="am-icon-heart"></i> <a href="">我关注的品牌</a>
				</li>
				<li class="sn-cart"><i class="am-icon-shopping-cart"></i> <a
					href="myshoppingCart.do">购物车</a> <c:set
						property="${sessionScope.map3 }" var="shoppingcart"></c:set> <span
					name="count"> <my:pt value="${sessionScope.map3 }" />
				</span> 件</li>
			</ul>
		</div>
	</div>

	<!--标题&搜索-->
	<div class="header">
		<div class="header-con">
			<h1 class="iGologo">
				<a href="">爱购iGo.com</a>
			</h1>
			<div class="search" name="search">
				<form action="searchkey.do" method="get">
					<input type="text" placeholder="潮女冬季必备" name="key"
						class="search-inp">
					<!-- 这里提供查询的类名 按名字搜索了 -->
					<input style="display: none" type="text" name="search_kind"
						value="name" class="search-inp">
					<button type="submit" class="search-btn">搜索</button>
				</form>
			</div>
		</div>
	</div>
	<b class="line"></b>

	<div class="center-title">
		<div class="center-title-content">我的爱购</div>
	</div>

	<!--个人中心-->
	<div class="center">
		<div class="col-main">
			<div class="main-wrap">

				<div class="user-order">

					<!--标题 -->
					<div class="am-cf am-padding">
						<div class="am-fl am-cf">
							<strong class="am-text-danger am-text-lg">订单管理</strong> / <small>Order</small>
						</div>
					</div>
					<hr />

					<div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

						<ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
							<li class="am-active"><a href="#tab1">所有订单</a></li>
							<li><a href="#tab2">待付款</a></li>
							<li><a href="#tab3">待发货</a></li>
							<li><a href="#tab4">待收货</a></li>
							<li><a href="#tab5">待评价</a></li>
						</ul>

						<div class="am-tabs-bd">
							<div class="am-tab-panel am-fade am-in am-active" id="tab1">
								<div class="order-top">
									<div class="th th-item">
										<td class="td-inner">商品</td>
									</div>
									<div class="th th-price">
										<td class="td-inner">单价</td>
									</div>
									<div class="th th-number">
										<td class="td-inner">数量</td>
									</div>
									<div class="th th-operation">
										<td class="td-inner">商品操作</td>
									</div>
									<div class="th th-amount">
										<td class="td-inner">合计</td>
									</div>
									<div class="th th-status">
										<td class="td-inner">交易状态</td>
									</div>
									<div class="th th-change">
										<td class="td-inner">交易操作</td>
									</div>
								</div>

								<div class="order-main">
									<div class="order-list">
										<div class="order-status2">
											<c:forEach items="${sessionScope.u.orders}" var="orders"
												varStatus="os">
												<div class="order-title">
													<div class="dd-num">
														订单编号：<a href="javascript:;">${orders.orderid }</a>
													</div>
													<span>成交时间：${orders.orderCreateTime }</span>
												</div>
												<div class="order-content">
													<div class="order-left">
														<c:forEach items="${orders.orderdetail.willpaiedGoods }"
															var="item" varStatus="is">
															<ul class="item-list">
																<li class="td td-item">
																	<div class="item-pic">
																		<a href="#" class="J_MakePoint"> <img
																			src="uploads/${item.product.productImgAdd }"
																			width="80px" height="80px" class="itempic J_ItemImg">
																		</a>
																	</div>
																	<div class="item-info">
																		<div class="item-basic-info">
																			<a href="#">
																				<p>${item.product.productName }</p>
																				<p class="info-little">
																					${item.product.desciption } <br />
																				</p>
																			</a>
																		</div>
																	</div>
																</li>
																<li class="td td-price">
																	<div class="item-price">${item.product.price }</div>
																</li>
																<li class="td td-number">
																	<div class="item-number">
																		<span>×</span>${item.amount }
																	</div>
																</li>

																<c:choose>
																	<c:when test="${orders.ordertype.orderTypeId==2 }">
																		<li class="td td-operation">
																			<div class="item-operation">
																				<a data-brackets-id="322" href="refund.html">退款</a>
																			</div>
																		</li>
																	</c:when>
																	<c:when test="${orders.ordertype.orderTypeId==1 }">
																		<li class="td td-operation"></li>
																	</c:when>
																	<c:when test="${orders.ordertype.orderTypeId==3 }">
																		<li class="td td-operation">
																			<div class="item-operation">
																				<a data-brackets-id="322" href="refund.html">退款/退货</a>
																			</div>
																		</li>
																	</c:when>

																</c:choose>
															</ul>
														</c:forEach>


													</div>
													<div class="order-right">
														<li class="td td-amount">
															<div class="item-amount">
																合计：${orders.orderdetail.moneyTotal }
																<p>
																	含运费：<span>10.00</span>
																</p>
															</div>
														</li>
														<div class="move-right">
															<c:choose>
																<c:when test="${orders.ordertype.orderTypeId==2 }">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">买家已付款</p>
																			<p class="order-info">
																				<a href="orderinfo.do?orderId=${orders.orderid }">订单详情</a>
																			</p>
																		</div>
																	</li>
																	<li class="td td-change">
																		<div class="am-btn am-btn-danger anniu">提醒发货</div>
																	</li>
																</c:when>
																<c:when test="${orders.ordertype.orderTypeId==1 }">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">等待买家付款</p>
																			<p class="order-info">
																				<a href="#">取消订单</a>
																			</p>

																		</div>
																	</li>
																	<li class="td td-change"><a href="pay.html">
																			<div class="am-btn am-btn-danger anniu">一键支付</div>
																	</a></li>


																</c:when>
																<c:when test="${orders.ordertype.orderTypeId==3 }">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">卖家已发货</p>
																			<p class="order-info">
																				<a href="orderinfo.do?orderId=${orders.orderid }">订单详情</a>
																			</p>
																			<p class="order-info">
																				<a href="logistics.html">查看物流</a>
																			</p>
																			<p class="order-info">
																				<a href="#">延长收货</a>
																			</p>
																		</div>
																	</li>
																	<li id="sure_receive" class="td td-change sure_receive">
																		<div class="am-btn am-btn-danger anniu">确认收货</div>
																	</li>
																</c:when>
																<c:when test="${orders.ordertype.orderTypeId==4 }">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">交易成功</p>
																			<p class="order-info">
																				<a href="orderinfo.do?orderId=${orders.orderid}">订单详情</a>
																			</p>
																			<p class="order-info">
																				<a href="logistics.html">查看物流</a>
																			</p>
																		</div>
																	</li>
																	<li class="td td-change"><a
																		href="commentlist.html">
																			<div class="am-btn am-btn-danger anniu">评价商品</div>
																	</a></li>
																</c:when>
															</c:choose>

														</div>
													</div>
												</div>
											</c:forEach>
										</div>
									</div>
								</div>
							</div>















							<div class="am-tab-panel am-fade" id="tab2">

								<div class="order-top">
									<div class="th th-item">
										<td class="td-inner">商品</td>
									</div>
									<div class="th th-price">
										<td class="td-inner">单价</td>
									</div>
									<div class="th th-number">
										<td class="td-inner">数量</td>
									</div>
									<div class="th th-operation">
										<td class="td-inner">商品操作</td>
									</div>
									<div class="th th-amount">
										<td class="td-inner">合计</td>
									</div>
									<div class="th th-status">
										<td class="td-inner">交易状态</td>
									</div>
									<div class="th th-change">
										<td class="td-inner">交易操作</td>
									</div>
								</div>





								<div class="order-main">
									<div class="order-list">
										<c:forEach items="${sessionScope.u.orders}" var="items1">
											<c:choose>
												<c:when test="${items1.ordertype.orderTypeId==1 }">
													<div class="order-status1">
														<div class="order-title">
															<div class="dd-num">
																订单编号：<a href="javascript:;">${items1.orderid }</a>
															</div>
															<span>成交时间：${items1.orderCreateTime }</span>
														</div>
														<div class="order-content">
															<div class="order-left">
																<c:forEach items="${items1.orderdetail.willpaiedGoods }"
																	var="item1">
																	<ul class="item-list">
																		<li class="td td-item">
																			<div class="item-pic">
																				<a href="#" class="J_MakePoint"> <img
																					src="uploads/${item1.product.productImgAdd }"
																					width="80px" height="80px"
																					class="itempic J_ItemImg">
																				</a>
																			</div>
																			<div class="item-info">
																				<div class="item-basic-info">
																					<a href="#">
																						<p>${item1.product.productName }</p>
																						<p class="info-little">
																							${item1.product.desciption } <br />
																						</p>
																					</a>
																				</div>
																			</div>
																		</li>
																		<li class="td td-price">
																			<div class="item-price">${item1.product.price }</div>
																		</li>
																		<li class="td td-number">
																			<div class="item-number">
																				<span>×</span>${item1.amount }
																			</div>
																		</li>
																		<li class="td td-operation"></li>

																	</ul>
																</c:forEach>

															</div>
															<div class="order-right">
																<li class="td td-amount">
																	<div class="item-amount">
																		合计：${items1.orderdetail.moneyTotal }
																		<p>
																			含运费：<span>10.00</span>
																		</p>
																	</div>
																</li>
																<div class="move-right">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">等待买家付款</p>
																			<p class="order-info">
																				<a href="#">取消订单</a>
																			</p>

																		</div>
																	</li>
																	<li class="td td-change"><a href="pay.html">
																			<div class="am-btn am-btn-danger anniu">一键支付</div>
																	</a></li>
																</div>
															</div>

														</div>
													</div>
												</c:when>
											</c:choose>

										</c:forEach>
									</div>

								</div>
							</div>
							<div class="am-tab-panel am-fade" id="tab3">
								<div class="order-top">
									<div class="th th-item">
										<td class="td-inner">商品</td>
									</div>
									<div class="th th-price">
										<td class="td-inner">单价</td>
									</div>
									<div class="th th-number">
										<td class="td-inner">数量</td>
									</div>
									<div class="th th-operation">
										<td class="td-inner">商品操作</td>
									</div>
									<div class="th th-amount">
										<td class="td-inner">合计</td>
									</div>
									<div class="th th-status">
										<td class="td-inner">交易状态</td>
									</div>
									<div class="th th-change">
										<td class="td-inner">交易操作</td>
									</div>
								</div>

								<div class="order-main">
									<div class="order-list">
										<c:forEach items="${sessionScope.u.orders}" var="items2">
											<c:choose>
												<c:when test="${items2.ordertype.orderTypeId==2 }">
													<div class="order-status2">
														<div class="order-title">
															<div class="dd-num">
																订单编号：<a href="javascript:;">${items2.orderid }</a>
															</div>
															<span>成交时间：${items2.orderCreateTime }</span>
														</div>
														<div class="order-content">
															<div class="order-left">
																<c:forEach items="${items2.orderdetail.willpaiedGoods }"
																	var="item2">
																	<ul class="item-list">
																		<li class="td td-item">
																			<div class="item-pic">
																				<a href="#" class="J_MakePoint"> <img
																					src="uploads/${item2.product.productImgAdd }"
																					width="80px" height="80px"
																					class="itempic J_ItemImg">
																				</a>
																			</div>
																			<div class="item-info">
																				<div class="item-basic-info">
																					<a href="#">
																						<p>${item2.product.productName }</p>
																						<p class="info-little">
																							${item2.product.desciption } <br />
																						</p>
																					</a>
																				</div>
																			</div>
																		</li>
																		<li class="td td-price">
																			<div class="item-price">${item2.product.price }</div>
																		</li>
																		<li class="td td-number">
																			<div class="item-number">
																				<span>×</span>${item2.amount }
																			</div>
																		</li>
																		<li class="td td-operation"></li>

																	</ul>
																</c:forEach>

															</div>
															<div class="order-right">
																<li class="td td-amount">
																	<div class="item-amount">
																		合计：${items2.orderdetail.moneyTotal }
																		<p>
																			含运费：<span>10.00</span>
																		</p>
																	</div>
																</li>
																<div class="move-right">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">买家已付款</p>
																			<p class="order-info">
																				<a href="orderinfo.do?orderId=${items2.orderid}">订单详情</a>
																			</p>
																		</div>
																	</li>
																	<li class="td td-change">
																		<div class="am-btn am-btn-danger anniu">提醒发货</div>
																	</li>
																</div>
															</div>

														</div>
													</div>
												</c:when>
											</c:choose>
										</c:forEach>
									</div>
								</div>
							</div>
							<div class="am-tab-panel am-fade" id="tab4">
								<div class="order-top">
									<div class="th th-item">
										<td class="td-inner">商品</td>
									</div>
									<div class="th th-price">
										<td class="td-inner">单价</td>
									</div>
									<div class="th th-number">
										<td class="td-inner">数量</td>
									</div>
									<div class="th th-operation">
										<td class="td-inner">商品操作</td>
									</div>
									<div class="th th-amount">
										<td class="td-inner">合计</td>
									</div>
									<div class="th th-status">
										<td class="td-inner">交易状态</td>
									</div>
									<div class="th th-change">
										<td class="td-inner">交易操作</td>
									</div>
								</div>

								<div class="order-main">
									<div class="order-list">
										<c:forEach items="${sessionScope.u.orders}" var="items3">
											<c:choose>
												<c:when test="${items3.ordertype.orderTypeId==3 }">
													<div class="order-status3">
														<div class="order-title">
															<div class="dd-num">
																订单编号：<a href="javascript:;">${items3.orderid }</a>
															</div>
															<span>成交时间：${items3.orderCreateTime }</span>
														</div>
														<div class="order-content">
															<div class="order-left">
																<c:forEach items="${items3.orderdetail.willpaiedGoods }"
																	var="item3">
																	<ul class="item-list">
																		<li class="td td-item">
																			<div class="item-pic">
																				<a href="#" class="J_MakePoint"> <img
																					src="uploads/${item3.product.productImgAdd }"
																					width="80px" height="80px"
																					class="itempic J_ItemImg">
																				</a>
																			</div>
																			<div class="item-info">
																				<div class="item-basic-info">
																					<a href="#">
																						<p>${item3.product.productName }</p>
																						<p class="info-little">
																							${item3.product.desciption } <br />
																						</p>
																					</a>
																				</div>
																			</div>
																		</li>
																		<li class="td td-price">
																			<div class="item-price">${item3.product.price }</div>
																		</li>
																		<li class="td td-number">
																			<div class="item-number">
																				<span>×</span>${item3.amount }
																			</div>
																		</li>
																		<li class="td td-operation"></li>

																	</ul>
																</c:forEach>

															</div>
															<div class="order-right">
																<li class="td td-amount">
																	<div class="item-amount">
																		合计：${items3.orderdetail.moneyTotal }
																		<p>
																			含运费：<span>10.00</span>
																		</p>
																	</div>
																</li>
																<div class="move-right">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">卖家已发货</p>
																			<p class="order-info">
																				<a href="orderinfo.do?orderId=${items3.orderid}">订单详情</a>
																			</p>
																			<p class="order-info">
																				<a href="logistics.html">查看物流</a>
																			</p>
																			<p class="order-info">
																				<a href="#">延长收货</a>
																			</p>
																		</div>
																	</li>
																	<li  class="td td-change sure_receive">
																		<div class="am-btn am-btn-danger anniu">确认收货</div>
																	</li>
																</div>
															</div>

														</div>
													</div>
												</c:when>
											</c:choose>
										</c:forEach>
									</div>
								</div>
							</div>

							<div class="am-tab-panel am-fade" id="tab5">
								<div class="order-top">
									<div class="th th-item">
										<td class="td-inner">商品</td>
									</div>
									<div class="th th-price">
										<td class="td-inner">单价</td>
									</div>
									<div class="th th-number">
										<td class="td-inner">数量</td>
									</div>
									<div class="th th-operation">
										<td class="td-inner">商品操作</td>
									</div>
									<div class="th th-amount">
										<td class="td-inner">合计</td>
									</div>
									<div class="th th-status">
										<td class="td-inner">交易状态</td>
									</div>
									<div class="th th-change">
										<td class="td-inner">交易操作</td>
									</div>
								</div>

								<div class="order-main">
									<div class="order-list">
										<c:forEach items="${sessionScope.u.orders}" var="items4">
											<c:choose>
												<c:when test="${items4.ordertype.orderTypeId==4 }">
													<div class="order-status4">
														<div class="order-title">
															<div class="dd-num">
																订单编号：<a href="javascript:;">${items4.orderid }</a>
															</div>
															<span>成交时间：${items4.orderCreateTime }</span>
														</div>
														<div class="order-content">
															<div class="order-left">
																<c:forEach items="${items4.orderdetail.willpaiedGoods }"
																	var="item4">
																	<ul class="item-list">
																		<li class="td td-item">
																			<div class="item-pic">
																				<a href="#" class="J_MakePoint"> <img
																					src="uploads/${item4.product.productImgAdd }"
																					width="80px" height="80px"
																					class="itempic J_ItemImg">
																				</a>
																			</div>
																			<div class="item-info">
																				<div class="item-basic-info">
																					<a href="#">
																						<p>${item4.product.productName }</p>
																						<p class="info-little">
																							${item4.product.desciption } <br />
																						</p>
																					</a>
																				</div>
																			</div>
																		</li>
																		<li class="td td-price">
																			<div class="item-price">${item4.product.price }</div>
																		</li>
																		<li class="td td-number">
																			<div class="item-number">
																				<span>×</span>${item4.amount }
																			</div>
																		</li>
																		<li class="td td-operation"></li>

																	</ul>
																</c:forEach>

															</div>
															<div class="order-right">
																<li class="td td-amount">
																	<div class="item-amount">
																		合计：${items4.orderdetail.moneyTotal }
																		<p>
																			含运费：<span>10.00</span>
																		</p>
																	</div>
																</li>
																<div class="move-right">
																	<li class="td td-status">
																		<div class="item-status">
																			<p class="Mystatus">交易成功</p>
																			<p class="order-info">
																				<a href="orderinfo.do?orderId=${items4.orderid}">订单详情</a>
																			</p>
																			<p class="order-info">
																				<a href="logistics.html">查看物流</a>
																			</p>
																		</div>
																	</li>
																	<li class="td td-change"><a
																		href="commentlist.html">
																			<div class="am-btn am-btn-danger anniu">评价商品</div>
																	</a></li>
																</div>
															</div>

														</div>
													</div>
												</c:when>
											</c:choose>
										</c:forEach>

									</div>

								</div>

							</div>
						</div>

					</div>
				</div>
			</div>
		</div>

		<aside class="menu">
			<ul>
				<li class="person"><a href="myorders.do">个人中心</a></li>
				<li class="person"><a href="myorders.do">我的爱购</a>
					<ul>
						<li><a href="myshoppingCart.do">我的购物车</a></li>
						<li><a href="">我的收藏</a></li>
						<li><a href="">我的足迹</a></li>
						<li><a href="">我的评价</a></li>
						<li><a href="">消息</a></li>
					</ul></li>
				<li class="person"><a href="#">我的交易</a>
					<ul>
						<li class="active"><a href="myorders.do">订单管理</a></li>
						<li><a href="">退款售后</a></li>
					</ul></li>
				<li class="person"><a href="#">账户设置</a>
					<ul>
						<li><a href="">个人信息</a></li>
						<li><a href="">安全设置</a></li>
						<li><a href="">收货地址</a></li>
					</ul></li>
				<li class="person"><a href="#">我的资产</a>
					<ul>
						<li><a href="">优惠券 </a></li>
						<li><a href="">红包</a></li>
						<li><a href="">账单明细</a></li>
					</ul></li>
			</ul>

		</aside>


		<!--底部-->
		<div class="clear"></div>
		<div class="footer">
			<div class="footer-hd">
				<p>
					<a href="#">爱购集团</a> <b>|</b> <a href="#">商城首页</a> <b>|</b> <a
						href="#">支付宝</a> <b>|</b> <a href="#">物流</a>
				</p>
			</div>
			<div class="footer-bd">
				<p>
					<a href="#">关于爱购</a> <a href="#">合作伙伴</a> <a href="#">联系我们</a> <a
						href="#">网站地图</a> <em>(c) 2016-2026 iGo.com 版权所有</em>
				</p>
			</div>
		</div>

	</div>
<script type="text/javascript">
	$(function(){
		$(".sure_receive").click(function(){
			var orderId = $(this).parent().parent().parent().prev().find(".dd-num a").text();
			var ans = confirm("是否确认收获");
			if(ans){
				$.ajax({
					url: base_path +"/makesureReceive.do",
					dataType:"json",
					type:"post",
					data:{
						"orderId":orderId
					},
					success:function(result){
						if(result.status==0){
							alert("确认收货成功!");
							location.reload();
						}
					},
					error:function(){
						alert("确认收货失败");
					}
				});
			}
		})
	})
</script>
</body>

</html>